package com.adingxiong.itemservice.service.imp;

import com.adingxiong.pojo.Item;
import com.adingxiong.service.ItemService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName ItemServiceImpl
 * @Description TODO
 * @Author xiongchao
 * @Date 2020/7/30 14:31
 **/
@Service
@Slf4j
public class ItemServiceImpl implements ItemService {

    @Override
    public List<Item> getItems(String s) {
        List<Item> list = new ArrayList<>();
        for(int i =0 ;i<6 ;i++){
            list.add(new Item(i , "商品序号" + i , i));
        }

        return list;
    }

    @Override
    public void decreaseNumbers(List<Item> list) {
        for (Item i : list){
            log.info("库存减少{}" , i);
        }
    }
}
